package com.weir.workdemo.work01.future.forkjoin;

import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.Callable;
import java.util.concurrent.TimeUnit;

/**
 * @author weir
 */
@Slf4j
@AllArgsConstructor
public class MyTestTask implements Callable<Void> {
    private int sleepTime;

    @Override
    public Void call() throws Exception {
        try {
            log.debug("线程入库使用了{}s...", sleepTime);
            TimeUnit.SECONDS.sleep(sleepTime);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        log.debug("线程休息结束");
        return null;
    }
}
